package top.jle.wx.proxy.feign.fans;

import com.alibaba.fastjson2.JSONObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(url = "https://api.weixin.qq.com",name="fans")
public interface FansAPIFeign {

    /**
     * 批量获取粉丝ID列表 上限10000个 可使用nextOpenId多次调用
     * @param accessToken
     * @param nextOpenId
     * @return
     */
    @GetMapping("/cgi-bin/user/get")
    JSONObject getFansIdList(@RequestParam("next_openid")String nextOpenId);

    /**
     * 根据粉丝ID获取粉丝详情
     * @param accessToken
     * @param openId
     * @return
     */
    @GetMapping("/cgi-bin/user/info")
    JSONObject fansInfo(@RequestParam("openid")String openId);

    /**
     * 根据粉丝ID列表批量获取粉丝详情
     * @param accessToken
     * @param openIdList
     * @return
     */
    @PostMapping("/cgi-bin/user/info/batchget")
    JSONObject fansInfoList(@RequestBody JSONObject openIdList);


}
